package com.prj.dao;

import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.prj.entity.TM;

@Mapper
public interface TMDao extends BaseMapper<TM>{
	
	Page  queryList(@Param("page") Page page, @Param("param") Map params);

	@Update("<script>"
			+ " UPDATE tm SET rn = RAND() "
			+ "<if test = 'type != null and type!=\"\"'>"
			+ "   ,is_show = 1"
			+ "</if> "
			+ "</script> ")
	void updateRand( @Param("type") String type);

	@Update("update tm set is_show = 0 where tk_id = #{tkId}")
	void updateSuccess( @Param("tkId")Long tkId);

}
